import { reactive } from 'vue'

const userStore = {

    //状态
    userState: reactive({
        message: 'Hello!'
    }),

    debug: true,
    debuglog(){
        this.debug && console.warn("store debug logs:", ...arguments);
    },
  
    setMessageAction(newValue) {
        this.debuglog('setMessageAction triggered with', newValue)
        this.userState.message = newValue
    },
    clearMessageAction() {
      this.debuglog('clearMessageAction triggered')
      this.userState.message = ''
    }
}

export {
    userStore
}